package cn.ibizlab.odoo.core.odoo_gamification.service.impl;

import java.io.Serializable;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.HashMap;
import java.math.BigInteger;
import java.util.Collection;

import lombok.extern.slf4j.Slf4j;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.stereotype.Service;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import cn.ibizlab.odoo.core.client.model.Igamification_challenge;
import cn.ibizlab.odoo.core.odoo_gamification.domain.Gamification_challenge;
import cn.ibizlab.odoo.core.odoo_gamification.filter.Gamification_challengeSearchContext;
import cn.ibizlab.odoo.core.odoo_gamification.service.IGamification_challengeService;
import cn.ibizlab.odoo.util.SearchResult;
import cn.ibizlab.odoo.util.log.IBIZLog;

/**
 * 实体[游戏化挑战] 服务对象接口实现
 */
@Slf4j
@IBIZLog
@Service
public class Gamification_challengeServiceImpl implements IGamification_challengeService {

    @Autowired
    private cn.ibizlab.odoo.core.client.service.Igamification_challengeClientService gamification_challengeClientService;

    @Override
    public boolean remove(Integer id) {
        boolean bOk = false ;
        Igamification_challenge clientModel = gamification_challengeClientService.createModel();
        clientModel.setId(id);
        gamification_challengeClientService.remove(clientModel) ;
        bOk = true ;
        return bOk ;
    }

    @Override
    public void updateBatch(List<Gamification_challenge> gamification_challenges, int batchSize) {

        //gamification_challengeClientService.updateBatch(gamification_challenges,batchSize) ;

    }

    @Override
    public Gamification_challenge get(Integer id) {
        Igamification_challenge clientModel = gamification_challengeClientService.createModel();
        clientModel.setId(id);
        gamification_challengeClientService.get(clientModel) ;
        return this.convert2Domain(clientModel,null);
    }

    @Override
    public Gamification_challenge get(Gamification_challenge gamification_challenge) {
        Gamification_challenge retgamification_challenge = this.get(gamification_challenge.getId()) ;
    	BeanCopier copier=BeanCopier.create(retgamification_challenge.getClass(), gamification_challenge.getClass(), false);
        copier.copy(retgamification_challenge, gamification_challenge, null);
        return gamification_challenge ;
    }

    @Override
    public void removeBatch(Collection<? extends Serializable> idList, int batchSize) {

        //gamification_challengeClientService.removeBatch(gamification_challenges) ;

    }

    @Override
    public boolean update(Gamification_challenge gamification_challenge) {
        boolean bOk = false ;
        Igamification_challenge clientModel = this.convert2Model(gamification_challenge,null);
        gamification_challengeClientService.update(clientModel) ;
        this.convert2Domain(clientModel,gamification_challenge) ;
        bOk = true;
        return bOk ;
    }

    @Override
    public boolean create(Gamification_challenge gamification_challenge) {
        boolean bOk = false ;
        Igamification_challenge clientModel = this.convert2Model(gamification_challenge,null);
        gamification_challengeClientService.create(clientModel) ;
        this.convert2Domain(clientModel,gamification_challenge);
        bOk = true ;

        return bOk ;
    }

    @Override
    public void createBatch(List<Gamification_challenge> gamification_challenges, int batchSize) {

                        //gamification_challengeClientService.createBatch(gamification_challenges,batchSize) ;

    }

    /**
     * 查询集合 默认查询
     */
    @Override
    public Page<Gamification_challenge> searchDefault(Gamification_challengeSearchContext context) {
        List<Gamification_challenge> list = new ArrayList<Gamification_challenge>();
        Page<cn.ibizlab.odoo.core.client.model.Igamification_challenge> clientModelList = gamification_challengeClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Igamification_challenge clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Gamification_challenge>(list, context.getPageable(), clientModelList.getTotalElements());
    }


    /**
     * 根据游戏化徽章查询
     */
    @Override
    public Page<Gamification_challenge> selectByOdoo_reward_first(Integer id){
        Gamification_challengeSearchContext context = new Gamification_challengeSearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Gamification_challenge> list = new ArrayList<Gamification_challenge>();
        Page<cn.ibizlab.odoo.core.client.model.Igamification_challenge> clientModelList = gamification_challengeClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Igamification_challenge clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Gamification_challenge>(list, context.getPageable(), clientModelList.getTotalElements());

    }

    /**
     * 根据游戏化徽章查询
     */
    @Override
    public Page<Gamification_challenge> selectByOdoo_reward(Integer id){
        Gamification_challengeSearchContext context = new Gamification_challengeSearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Gamification_challenge> list = new ArrayList<Gamification_challenge>();
        Page<cn.ibizlab.odoo.core.client.model.Igamification_challenge> clientModelList = gamification_challengeClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Igamification_challenge clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Gamification_challenge>(list, context.getPageable(), clientModelList.getTotalElements());

    }

    /**
     * 根据游戏化徽章查询
     */
    @Override
    public Page<Gamification_challenge> selectByOdoo_reward_second(Integer id){
        Gamification_challengeSearchContext context = new Gamification_challengeSearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Gamification_challenge> list = new ArrayList<Gamification_challenge>();
        Page<cn.ibizlab.odoo.core.client.model.Igamification_challenge> clientModelList = gamification_challengeClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Igamification_challenge clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Gamification_challenge>(list, context.getPageable(), clientModelList.getTotalElements());

    }

    /**
     * 根据游戏化徽章查询
     */
    @Override
    public Page<Gamification_challenge> selectByOdoo_reward_third(Integer id){
        Gamification_challengeSearchContext context = new Gamification_challengeSearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Gamification_challenge> list = new ArrayList<Gamification_challenge>();
        Page<cn.ibizlab.odoo.core.client.model.Igamification_challenge> clientModelList = gamification_challengeClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Igamification_challenge clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Gamification_challenge>(list, context.getPageable(), clientModelList.getTotalElements());

    }

    /**
     * 根据讨论频道查询
     */
    @Override
    public Page<Gamification_challenge> selectByOdoo_report_message_group(Integer id){
        Gamification_challengeSearchContext context = new Gamification_challengeSearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Gamification_challenge> list = new ArrayList<Gamification_challenge>();
        Page<cn.ibizlab.odoo.core.client.model.Igamification_challenge> clientModelList = gamification_challengeClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Igamification_challenge clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Gamification_challenge>(list, context.getPageable(), clientModelList.getTotalElements());

    }

    /**
     * 根据EMail模板查询
     */
    @Override
    public Page<Gamification_challenge> selectByOdoo_report_template(Integer id){
        Gamification_challengeSearchContext context = new Gamification_challengeSearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Gamification_challenge> list = new ArrayList<Gamification_challenge>();
        Page<cn.ibizlab.odoo.core.client.model.Igamification_challenge> clientModelList = gamification_challengeClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Igamification_challenge clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Gamification_challenge>(list, context.getPageable(), clientModelList.getTotalElements());

    }

    /**
     * 根据用户查询
     */
    @Override
    public Page<Gamification_challenge> selectByOdoo_create(Integer id){
        Gamification_challengeSearchContext context = new Gamification_challengeSearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Gamification_challenge> list = new ArrayList<Gamification_challenge>();
        Page<cn.ibizlab.odoo.core.client.model.Igamification_challenge> clientModelList = gamification_challengeClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Igamification_challenge clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Gamification_challenge>(list, context.getPageable(), clientModelList.getTotalElements());

    }

    /**
     * 根据用户查询
     */
    @Override
    public Page<Gamification_challenge> selectByOdoo_manager(Integer id){
        Gamification_challengeSearchContext context = new Gamification_challengeSearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Gamification_challenge> list = new ArrayList<Gamification_challenge>();
        Page<cn.ibizlab.odoo.core.client.model.Igamification_challenge> clientModelList = gamification_challengeClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Igamification_challenge clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Gamification_challenge>(list, context.getPageable(), clientModelList.getTotalElements());

    }

    /**
     * 根据用户查询
     */
    @Override
    public Page<Gamification_challenge> selectByOdoo_write(Integer id){
        Gamification_challengeSearchContext context = new Gamification_challengeSearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Gamification_challenge> list = new ArrayList<Gamification_challenge>();
        Page<cn.ibizlab.odoo.core.client.model.Igamification_challenge> clientModelList = gamification_challengeClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Igamification_challenge clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Gamification_challenge>(list, context.getPageable(), clientModelList.getTotalElements());

    }



    public Igamification_challenge convert2Model(Gamification_challenge domain , Igamification_challenge model) {
        if(domain == null)
            return model ;
        if(model==null){
            model = gamification_challengeClientService.createModel() ;
        }

         if(domain.getWebsite_message_idsDirtyFlag())
            model.setWebsite_message_ids(domain.getWebsite_message_ids());
         if(domain.getNameDirtyFlag())
            model.setName(domain.getName());
         if(domain.getMessage_needactionDirtyFlag())
            model.setMessage_needaction(domain.getMessage_needaction());
         if(domain.getIdDirtyFlag())
            model.setId(domain.getId());
         if(domain.getCreate_dateDirtyFlag())
            model.setCreate_date(domain.getCreate_date());
         if(domain.getMessage_unreadDirtyFlag())
            model.setMessage_unread(domain.getMessage_unread());
         if(domain.getStart_dateDirtyFlag())
            model.setStart_date(domain.getStart_date());
         if(domain.getMessage_has_error_counterDirtyFlag())
            model.setMessage_has_error_counter(domain.getMessage_has_error_counter());
         if(domain.getMessage_main_attachment_idDirtyFlag())
            model.setMessage_main_attachment_id(domain.getMessage_main_attachment_id());
         if(domain.getMessage_has_errorDirtyFlag())
            model.setMessage_has_error(domain.getMessage_has_error());
         if(domain.getLast_report_dateDirtyFlag())
            model.setLast_report_date(domain.getLast_report_date());
         if(domain.getEnd_dateDirtyFlag())
            model.setEnd_date(domain.getEnd_date());
         if(domain.getMessage_follower_idsDirtyFlag())
            model.setMessage_follower_ids(domain.getMessage_follower_ids());
         if(domain.getMessage_attachment_countDirtyFlag())
            model.setMessage_attachment_count(domain.getMessage_attachment_count());
         if(domain.getMessage_is_followerDirtyFlag())
            model.setMessage_is_follower(domain.getMessage_is_follower());
         if(domain.getUser_domainDirtyFlag())
            model.setUser_domain(domain.getUser_domain());
         if(domain.getCategoryDirtyFlag())
            model.setCategory(domain.getCategory());
         if(domain.getDescriptionDirtyFlag())
            model.setDescription(domain.getDescription());
         if(domain.getUser_idsDirtyFlag())
            model.setUser_ids(domain.getUser_ids());
         if(domain.getMessage_unread_counterDirtyFlag())
            model.setMessage_unread_counter(domain.getMessage_unread_counter());
         if(domain.getLine_idsDirtyFlag())
            model.setLine_ids(domain.getLine_ids());
         if(domain.getReport_message_frequencyDirtyFlag())
            model.setReport_message_frequency(domain.getReport_message_frequency());
         if(domain.getMessage_partner_idsDirtyFlag())
            model.setMessage_partner_ids(domain.getMessage_partner_ids());
         if(domain.getDisplay_nameDirtyFlag())
            model.setDisplay_name(domain.getDisplay_name());
         if(domain.getMessage_channel_idsDirtyFlag())
            model.setMessage_channel_ids(domain.getMessage_channel_ids());
         if(domain.getMessage_idsDirtyFlag())
            model.setMessage_ids(domain.getMessage_ids());
         if(domain.getReward_realtimeDirtyFlag())
            model.setReward_realtime(domain.getReward_realtime());
         if(domain.getReward_failureDirtyFlag())
            model.setReward_failure(domain.getReward_failure());
         if(domain.getPeriodDirtyFlag())
            model.setPeriod(domain.getPeriod());
         if(domain.getVisibility_modeDirtyFlag())
            model.setVisibility_mode(domain.getVisibility_mode());
         if(domain.getRemind_update_delayDirtyFlag())
            model.setRemind_update_delay(domain.getRemind_update_delay());
         if(domain.getWrite_dateDirtyFlag())
            model.setWrite_date(domain.getWrite_date());
         if(domain.get__last_updateDirtyFlag())
            model.set__last_update(domain.get__last_update());
         if(domain.getInvited_user_idsDirtyFlag())
            model.setInvited_user_ids(domain.getInvited_user_ids());
         if(domain.getMessage_needaction_counterDirtyFlag())
            model.setMessage_needaction_counter(domain.getMessage_needaction_counter());
         if(domain.getStateDirtyFlag())
            model.setState(domain.getState());
         if(domain.getNext_report_dateDirtyFlag())
            model.setNext_report_date(domain.getNext_report_date());
         if(domain.getManager_id_textDirtyFlag())
            model.setManager_id_text(domain.getManager_id_text());
         if(domain.getReport_message_group_id_textDirtyFlag())
            model.setReport_message_group_id_text(domain.getReport_message_group_id_text());
         if(domain.getReport_template_id_textDirtyFlag())
            model.setReport_template_id_text(domain.getReport_template_id_text());
         if(domain.getReward_id_textDirtyFlag())
            model.setReward_id_text(domain.getReward_id_text());
         if(domain.getReward_first_id_textDirtyFlag())
            model.setReward_first_id_text(domain.getReward_first_id_text());
         if(domain.getCreate_uid_textDirtyFlag())
            model.setCreate_uid_text(domain.getCreate_uid_text());
         if(domain.getWrite_uid_textDirtyFlag())
            model.setWrite_uid_text(domain.getWrite_uid_text());
         if(domain.getReward_second_id_textDirtyFlag())
            model.setReward_second_id_text(domain.getReward_second_id_text());
         if(domain.getReward_third_id_textDirtyFlag())
            model.setReward_third_id_text(domain.getReward_third_id_text());
         if(domain.getReward_first_idDirtyFlag())
            model.setReward_first_id(domain.getReward_first_id());
         if(domain.getReport_template_idDirtyFlag())
            model.setReport_template_id(domain.getReport_template_id());
         if(domain.getReward_second_idDirtyFlag())
            model.setReward_second_id(domain.getReward_second_id());
         if(domain.getReward_third_idDirtyFlag())
            model.setReward_third_id(domain.getReward_third_id());
         if(domain.getReport_message_group_idDirtyFlag())
            model.setReport_message_group_id(domain.getReport_message_group_id());
         if(domain.getReward_idDirtyFlag())
            model.setReward_id(domain.getReward_id());
         if(domain.getManager_idDirtyFlag())
            model.setManager_id(domain.getManager_id());
         if(domain.getWrite_uidDirtyFlag())
            model.setWrite_uid(domain.getWrite_uid());
         if(domain.getCreate_uidDirtyFlag())
            model.setCreate_uid(domain.getCreate_uid());
        return model ;
    }

    public Gamification_challenge convert2Domain( Igamification_challenge model ,Gamification_challenge domain) {
        if(model == null)
            return domain ;
        if(domain == null){
            domain = new Gamification_challenge();
        }

        if(model.getWebsite_message_idsDirtyFlag())
            domain.setWebsite_message_ids(model.getWebsite_message_ids());
        if(model.getNameDirtyFlag())
            domain.setName(model.getName());
        if(model.getMessage_needactionDirtyFlag())
            domain.setMessage_needaction(model.getMessage_needaction());
        if(model.getIdDirtyFlag())
            domain.setId(model.getId());
        if(model.getCreate_dateDirtyFlag())
            domain.setCreate_date(model.getCreate_date());
        if(model.getMessage_unreadDirtyFlag())
            domain.setMessage_unread(model.getMessage_unread());
        if(model.getStart_dateDirtyFlag())
            domain.setStart_date(model.getStart_date());
        if(model.getMessage_has_error_counterDirtyFlag())
            domain.setMessage_has_error_counter(model.getMessage_has_error_counter());
        if(model.getMessage_main_attachment_idDirtyFlag())
            domain.setMessage_main_attachment_id(model.getMessage_main_attachment_id());
        if(model.getMessage_has_errorDirtyFlag())
            domain.setMessage_has_error(model.getMessage_has_error());
        if(model.getLast_report_dateDirtyFlag())
            domain.setLast_report_date(model.getLast_report_date());
        if(model.getEnd_dateDirtyFlag())
            domain.setEnd_date(model.getEnd_date());
        if(model.getMessage_follower_idsDirtyFlag())
            domain.setMessage_follower_ids(model.getMessage_follower_ids());
        if(model.getMessage_attachment_countDirtyFlag())
            domain.setMessage_attachment_count(model.getMessage_attachment_count());
        if(model.getMessage_is_followerDirtyFlag())
            domain.setMessage_is_follower(model.getMessage_is_follower());
        if(model.getUser_domainDirtyFlag())
            domain.setUser_domain(model.getUser_domain());
        if(model.getCategoryDirtyFlag())
            domain.setCategory(model.getCategory());
        if(model.getDescriptionDirtyFlag())
            domain.setDescription(model.getDescription());
        if(model.getUser_idsDirtyFlag())
            domain.setUser_ids(model.getUser_ids());
        if(model.getMessage_unread_counterDirtyFlag())
            domain.setMessage_unread_counter(model.getMessage_unread_counter());
        if(model.getLine_idsDirtyFlag())
            domain.setLine_ids(model.getLine_ids());
        if(model.getReport_message_frequencyDirtyFlag())
            domain.setReport_message_frequency(model.getReport_message_frequency());
        if(model.getMessage_partner_idsDirtyFlag())
            domain.setMessage_partner_ids(model.getMessage_partner_ids());
        if(model.getDisplay_nameDirtyFlag())
            domain.setDisplay_name(model.getDisplay_name());
        if(model.getMessage_channel_idsDirtyFlag())
            domain.setMessage_channel_ids(model.getMessage_channel_ids());
        if(model.getMessage_idsDirtyFlag())
            domain.setMessage_ids(model.getMessage_ids());
        if(model.getReward_realtimeDirtyFlag())
            domain.setReward_realtime(model.getReward_realtime());
        if(model.getReward_failureDirtyFlag())
            domain.setReward_failure(model.getReward_failure());
        if(model.getPeriodDirtyFlag())
            domain.setPeriod(model.getPeriod());
        if(model.getVisibility_modeDirtyFlag())
            domain.setVisibility_mode(model.getVisibility_mode());
        if(model.getRemind_update_delayDirtyFlag())
            domain.setRemind_update_delay(model.getRemind_update_delay());
        if(model.getWrite_dateDirtyFlag())
            domain.setWrite_date(model.getWrite_date());
        if(model.get__last_updateDirtyFlag())
            domain.set__last_update(model.get__last_update());
        if(model.getInvited_user_idsDirtyFlag())
            domain.setInvited_user_ids(model.getInvited_user_ids());
        if(model.getMessage_needaction_counterDirtyFlag())
            domain.setMessage_needaction_counter(model.getMessage_needaction_counter());
        if(model.getStateDirtyFlag())
            domain.setState(model.getState());
        if(model.getNext_report_dateDirtyFlag())
            domain.setNext_report_date(model.getNext_report_date());
        if(model.getManager_id_textDirtyFlag())
            domain.setManager_id_text(model.getManager_id_text());
        if(model.getReport_message_group_id_textDirtyFlag())
            domain.setReport_message_group_id_text(model.getReport_message_group_id_text());
        if(model.getReport_template_id_textDirtyFlag())
            domain.setReport_template_id_text(model.getReport_template_id_text());
        if(model.getReward_id_textDirtyFlag())
            domain.setReward_id_text(model.getReward_id_text());
        if(model.getReward_first_id_textDirtyFlag())
            domain.setReward_first_id_text(model.getReward_first_id_text());
        if(model.getCreate_uid_textDirtyFlag())
            domain.setCreate_uid_text(model.getCreate_uid_text());
        if(model.getWrite_uid_textDirtyFlag())
            domain.setWrite_uid_text(model.getWrite_uid_text());
        if(model.getReward_second_id_textDirtyFlag())
            domain.setReward_second_id_text(model.getReward_second_id_text());
        if(model.getReward_third_id_textDirtyFlag())
            domain.setReward_third_id_text(model.getReward_third_id_text());
        if(model.getReward_first_idDirtyFlag())
            domain.setReward_first_id(model.getReward_first_id());
        if(model.getReport_template_idDirtyFlag())
            domain.setReport_template_id(model.getReport_template_id());
        if(model.getReward_second_idDirtyFlag())
            domain.setReward_second_id(model.getReward_second_id());
        if(model.getReward_third_idDirtyFlag())
            domain.setReward_third_id(model.getReward_third_id());
        if(model.getReport_message_group_idDirtyFlag())
            domain.setReport_message_group_id(model.getReport_message_group_id());
        if(model.getReward_idDirtyFlag())
            domain.setReward_id(model.getReward_id());
        if(model.getManager_idDirtyFlag())
            domain.setManager_id(model.getManager_id());
        if(model.getWrite_uidDirtyFlag())
            domain.setWrite_uid(model.getWrite_uid());
        if(model.getCreate_uidDirtyFlag())
            domain.setCreate_uid(model.getCreate_uid());
        return domain ;
    }


}
